﻿using System;
using ClieOp;
using NUnit.Framework;

namespace ClieOpTest
{
    [TestFixture]
    public class BatchTest
    {
        [Test]
        public void ToStringTest()
        {
            var batch = new Batch(5542965, new DateTime(2010, 10, 30), "Test");
            batch.AddPost(new Post((decimal)1.23, 786892692, "Roel van der Steen", "12345"));
            batch.AddPost(new Post((decimal)1.23, 786892692, "Roel van der Steen", "12345"));
            const string expected =
                "0010B1000055429650000EUR                          \r\n0030B1301010Test                               P  \r\n"
                + "0100A100100000000012307868926920005542965         \r\n0150A12345                                        \r\n"
                + "0100A100100000000012307868926920005542965         \r\n0150A12345                                        \r\n"
                + "9990A00000000000000024615848713140000002          \r\n";
            Assert.AreEqual(expected, batch.ToString());
        }
    }
}